
<form class="layui-form pt10" action="{:url()}" method="post" id="editForm">
  
    <div class="layui-form-item">
        <label class="layui-form-label">会员</label>
        <div class="layui-input-inline">
            <select name="user_id" class="layui-input field-user_id"  lay-verify="required" lay-search="">
              <option value="">直接选择或搜索选择</option>
              {$users|raw}
            </select>
        </div>
    </div>
    
    <div class="layui-form-item">
        <label class="layui-form-label">顾问</label>
        <div class="layui-input-inline">
            <select name="adviser_id" class="layui-input field-adviser_id"  lay-verify="required" lay-search="">
              <option value="">直接选择或搜索选择</option>
              {$advisers|raw}
            </select>
        </div>
        <div class="layui-form-mid layui-word-aux"></div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">美容师</label>
        <div class="layui-input-inline">
            <div id="technician_ids" style="width: 100%; "></div>
        </div>
        <div class="layui-form-mid layui-word-aux"></div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">账户</label>
        <div class="layui-input-inline">
            <select name="type" class="layui-input field-type" lay-verify="required" lay-search="">
              <option value="1">会员卡</option>
              <option value="2">赠送会员卡</option>
            </select>
        </div>
        <div class="layui-form-mid layui-word-aux"></div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">金额</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input field-price" name="price"  value="0.00" lay-verify="number" autocomplete="off" ">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">支出账户</label>
        <div class="layui-input-inline">
            <select name="account_id" class="layui-input field-account_id" lay-verify="required" lay-search="">
              <option value="">直接选择或搜索选择</option>
              {$accounts|raw}
            </select>
        </div>
        <div class="layui-form-mid layui-word-aux"></div>
    </div>

    {if $formData['status'] == 1}
    <div class="layui-form-item">
        <label class="layui-form-label">审核</label>
        <div class="layui-input-inline">
            <input type="radio" class="field-status" name="status" value="2" title="通过" checked>
            <input type="radio" class="field-statu" name="status" value="3" title="不通过">
        </div>
        <div class="layui-form-mid layui-word-aux"></div>
       
    </div>
    {else}
    <div class="layui-form-item">
        <div class="layui-input-block">
            <input type="hidden" class="" name="status" value="1">
        </div>
    </div>
    {/if}
    <div class="layui-form-item">
        <div class="layui-input-block">
            <input type="hidden" class="field-id" name="id">
        </div>
    </div>
    <div class="pop-bottom-bar hisi-footer">
        <button type="submit" class="layui-btn layui-btn-normal" lay-submit="" lay-filter="formSubmit" hisi-data="{pop: true, refresh: true}">提交保存</button>
        <a href="javascript:parent.layui.layer.closeAll();" class="layui-btn layui-btn-primary ml10">取消</a>
    </div>
</form>
<!-- <script src="__PUBLIC_JS__/layui/xm-select.js" charset="utf-8"></script> -->
{include file="system@block/layui" /}

<script>

layui.use(['func','laydate','xmSelect'], function() {
    //常规用法
    var laydate = layui.laydate;
    var xmSelect = layui.xmSelect;
    laydate.render({
          elem: '#date',
          trigger:'click',
          type:'datetime'
        });
    var technician_ids = xmSelect.render({
        el: '#technician_ids', 
        autoRow: true,
        name:'technician_ids',
        data: {:json_encode($technicians,true)},
        // disabled: true
    })
    console.log(technician_ids)
    technician_ids.setValue({:isset($formData.technician_ids) ? json_encode($formData.technician_ids,true) : ''})

    layui.func.assign({:json_encode($formData)});


});
</script>
